From 5a97284e2ce61c02ee870e53ab64f137295d1173 Mon Sep 17 00:00:00 2001 From: Ell Date: Thu, 8 Jun 2017 09:09:42 -0400 Subject: [PATCH] babl-gen-test-pixels: update floating-point format of output ... ... to match commit 37947d19cd217ef5a04da46627a60ccde8925122. --- tools/babl-gen-test-pixels.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/tools/babl-gen-test-pixels.c b/tools/babl-gen-test-pixels.c index 54c1b16..6dbd3cc 100644 --- a/tools/babl-gen-test-pixels.c +++ b/tools/babl-gen-test-pixels.c @@ -26,6 +26,12 @@ #define BABL_MODEL_NUM_TEST_PIXELS 512 #define BABL_TYPE_NUM_TEST_PIXELS 512 +#define BABL_COMPONENT_FMT_STR "%.13f" +#define BABL_PIXEL_FMT_STR BABL_COMPONENT_FMT_STR ", " \ + BABL_COMPONENT_FMT_STR ", " \ + BABL_COMPONENT_FMT_STR ", " \ + BABL_COMPONENT_FMT_STR + static double rand_double (void) { return (double) random () / RAND_MAX; @@ -45,10 +51,10 @@ static void gen_path_pixels (void) printf ("static const double babl_path_test_pixels[%d] = {\n", BABL_PATH_NUM_TEST_PIXELS * 4); - /* add 128 pixels in the valid range between 0.0 and 1.0 */ + /* add 256 pixels in the valid range between 0.0 and 1.0 */ for (i = 0; i < 256; i++) { - printf ("%a, %a, %a, %a,\n", + printf (BABL_PIXEL_FMT_STR ",\n", rand_double (), rand_double (), rand_double (), @@ -58,7 +64,7 @@ static void gen_path_pixels (void) /* add 16 pixels between -1.0 and 0.0 */ for (i = 0; i < 16; i++) { - printf ("%a, %a, %a, %a,\n", + printf (BABL_PIXEL_FMT_STR ",\n", rand_range_double (-1.0, 0.0), rand_range_double (-1.0, 0.0), rand_range_double (-1.0, 0.0), @@ -68,7 +74,7 @@ static void gen_path_pixels (void) /* add 16 pixels between 1.0 and 2.0 */ for (i = 0; i < 16; i++) { - printf ("%a, %a, %a, %a,\n", + printf (BABL_PIXEL_FMT_STR ",\n", rand_range_double (1.0, 2.0), rand_range_double (1.0, 2.0), rand_range_double (1.0, 2.0), @@ -77,7 +83,7 @@ static void gen_path_pixels (void) for (i = 288; i < BABL_PATH_NUM_TEST_PIXELS; i++) { - printf ("%a, %a, %a, %a,\n", + printf (BABL_PIXEL_FMT_STR ",\n", rand_double (), rand_double (), rand_double (), @@ -107,7 +113,7 @@ static void gen_model_pixels (void) /* add 128 pixels in the valid range between 0.0 and 1.0 */ for (i = 0; i < BABL_MODEL_NUM_TEST_PIXELS; i++) { - printf ("%a, %a, %a, %a,\n", + printf (BABL_PIXEL_FMT_STR ",\n", rand_range_double (-0.2, 1.2), rand_range_double (-0.2, 1.2), rand_range_double (-0.2, 1.2), @@ -129,7 +135,7 @@ static void gen_type_pixels (void) /* add 128 pixels in the valid range between 0.0 and 1.0 */ for (i = 0; i < BABL_MODEL_NUM_TEST_PIXELS; i++) { - printf ("%a, %a, %a, %a,\n", + printf (BABL_PIXEL_FMT_STR ",\n", rand_range_double (0.0, 128.0), rand_range_double (0.0, 128.0), rand_range_double (0.0, 128.0), -- 2.30.2